// 页面路径：store/index.js
import Vue from "vue";
import Vuex from "vuex";
import persistence from "vuex-uniapp-persistence";

Vue.use(Vuex); //vue的插件机制
//Vuex.Store 构造器选项
const store = new Vuex.Store({
  // 持久化插件使用
  plugins: [persistence()],
  state: {
    token: "",
    safeArea: uni.getSystemInfoSync().safeArea,
  },
  mutations: {
    setToken(state) {
      state.token = "6789";
    },
  },
  getters: {},
  modules: {},
});
export default store;
